| Add Some Capability to the Email Form 1. Bring up the Email.frm file. 2. Increase the height of the form. 3. Add a label to the form and set the Name property to lblLabel. 4. Set the Caption property to Address Book. 5. Add a list box to the form and set the Name property to lstAddresses. 6. Set the Style property to 1-CheckBox. 7. Add some email addresses to the List property of this list box. 8. Add a command button just below the list box. 9. Set the Name property to cmdTransfer. 10. Set the Caption property to nothing. 11. Set the Style property to 1-Graphical 12. Set the Picture property to ..\Visual Basic\Icons\Arrows\Arw06dn.ico. 13. Write the following code for the Click event of this command button: |
| Private Sub cmdTransfer_Click()
Dim intLoop As Integer
Dim strAddr As String
With lstAddresses For intLoop = 0 To .ListCount - 1 If .Selected(intLoop) Then
strAddr = strAddr & .List(intLoop) & "; "
End If Next intLoop End With
txtTo.Text = strAddr
End Sub |
 | The preceding code begins by creating two local variables. The intLoop variable is used to iterate over the list of items in the list box. The strAddr variable is used as a holding area for the addresses that have been selected. Each time through the loop, the Selected() property array is checked to see whether the item at the index of the loop is a |